#include<cstdio>
#include<cstring>
#include<cmath>
const int maxn=1001;
int p[maxn],r[maxn],x[maxn],y[maxn];
bool v[maxn];
int find(int i)
{
	int j=i,k,t;
	while(j!=p[j])j=p[j];
	for(k=i;k!=p[k];)
	{
		t=k;
		k=p[k];
		p[t]=j;
	}
	return j;
}
void merge(int x,int y)
{
	int r1=find(x);
	int r2=find(y);
	if(r1!=r2)
	{
		if(r[r1]>r[r2])p[r2]=r1;
		else
		{
			p[r1]=r2;
			if(r[r1]==r[r2])r[r2]++;
		}
	}
}
int dist(int x1,int y1,int x2,int y2)
{
	return (x1-x2)*(x1-x2)+(y1-y2)*(y1-y2);
}
int main()
{
	int n,d;
	scanf("%d%d",&n,&d);
	memset(v,0,sizeof(v));
	for(int i=1;i<=n;i++){p[i]=i;r[i]=1;}
	for(int i=1;i<=n;i++)
	   scanf("%d%d",&x[i],&y[i]);
	char op;
	while(scanf("%c%c",&op,&op)!=EOF)
	{
		if(op=='O')
		{
			int t;
			scanf("%d",&t);
			if(!v[t])
			{
				for(int i=1;i<=n;i++)
					if(v[i]&&d*d>=dist(x[i],y[i],x[t],y[t]))
						merge(i,t);
				v[t]=true;
			}
		}
		if(op=='S')
		{
			int x,y;
			scanf("%d%d",&x,&y);
			if(find(x)!=find(y))printf("FAIL\n");
			else printf("SUCCESS\n");
		}
	}
	return 0;
}
			

